package com.example.demo.database;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class FixedThreadPool {
	public static void main(String[] args) {
		Thread myThread = new Thread(new Runnable() {

			@Override
			public void run() {
				System.out.println(Thread.currentThread().getName());
			}
		});
		
		ExecutorService pool = Executors.newFixedThreadPool(4);
		
		
		
		for (int i = 0; i < 40; i++) {
			pool.submit(new Runnable() {
				
				@Override
				public void run() {
					System.out.println(Thread.currentThread().getName());
					
				}
			});
		}
		pool.shutdown();
	}
}
